#!/usr/bin/python
# -*- coding: UTF-8 -*-

import random

name = (u'夏立军 - 猜数字小游戏-')
print(name)

secret = random.randint(0,1024)

while True:
    alt = u'请输入一个数字(0-1024):'
    print(alt)
    num = input("> ")
    if num.isdigit():
        num = int(num)
        if num == secret:
            print(u'你赢了!')
            break
        else:
            if num > secret:
                print(u'你输入的数大了!')
            else:
                print(u'你输入的数小了!')
    else:
        print(u'你输入的类型有误!')

print(u'数字: %s' % (secret))
